home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 4 / Amiga Tools 4.iso / tools / internet-tools / connect-line / cl / rexx / modules / maps.clrexxmod next >
Encoding:
Text File  |  1996-02-08  |  24.9 KB  |  835 lines

  1. /*
  2. **  $VER: maps.clrexxmod 0.8 (07 Feb 1996)  **
  3. **
  4. **        © 1996 Ralf Ramge
  5. **
  6. **  PROGRAMNAME:
  7. **      maps.clrexxmod
  8. **
  9. **  FUNCTION:
  10. **      clrexx-Modul für MAPS-Befehle, entsprechend
  11. **      dem MAPS-Standard Anlage ZConnect 3.1
  12. **
  13. **      Bisherige Funktionen:
  14. **          ADD
  15. **          DEL
  16. **          HELP
  17. **          HOLDON (HOLD ON)
  18. **          HOLDOFF (HOLD OFF)
  19. **          INDEX
  20. **          LIST
  21. **
  22. **  $HISTORY:
  23. **
  24. **   18 Jan 1996 : 0.1 : initial release
  25. **   24 Jan 1996 : 0.2 : LIST implementiert
  26. **   25 Jan 1996 : 0.3 : LIST verschickt nun optional
  27. **                       auch an Systeme, die lokal
  28. **                       nicht bekannt sind.
  29. **                 0.4 : LIST verbessert
  30. **                       ADD implementiert
  31. **                       DEL implementiert
  32. **                 0.5 : INDEX implementiert
  33. **   03 Feb 1996 : 0.6 : HELP implementiert
  34. **                       INDEX prüfte nicht, ob es
  35. **                       sich um ein angeschlossenes
  36. **                       System handelt
  37. **                       Diverse kleinere Fixes
  38. **   06 Feb 1996 : 0.7 : ADD und DEL zusammengefasst
  39. **   07 Feb 1996 : 0.8 : Logfile-Unterstützung
  40. **                       Die Mailinhalte werden bei
  41. **                       der Erzeugung in STDOUT ge-
  42. **                       spiegelt
  43. **                       Falls vorhanden, wird die
  44. **                       globale ENV-Variable 'mapsmod'
  45. **                       ausgewertet. Diese beinhaltet
  46. **                       die gewünschte Taskpriorität.
  47. */
  48.  
  49. line=upper(arg(1))
  50. line=translate(line,' ',',')
  51. procname=word(line,1)
  52. objname=word(line,2)
  53. if words(line)>2 then do
  54.     do argctr=1 to words(line)
  55.         param.argctr=word(line,argctr+2)
  56.         end
  57.     end
  58.  
  59. if open('env','ENV:mapsmod','R') then do
  60.     call pragma 'P',readln('env')
  61.     call close 'env'
  62.     address command 'delete >NIL: ENV:mapsmod'
  63.     end
  64.  
  65. ctr=0
  66.  
  67. /* cl_rexx.library öffnen */
  68.  
  69. if ~show('L','cl_rexx.library') then do
  70.     if ~addlib('cl_rexx.library',0,-30,0) then exit 10
  71.     end
  72.  
  73. select
  74.     when procname='HOLDOFF' then interpret 'call' procname
  75.     when procname='HOLDON' then interpret 'call' procname
  76.     when procname='LIST' then interpret 'call' procname
  77.     when procname='ADD' then interpret 'call' procname
  78.     when procname='DEL' then interpret 'call' procname
  79.     when procname='INDEX' then interpret 'call' procname
  80.     when procname='HELP' then interpret 'call' procname
  81.     when procname='ERROR' then interpret 'call' procname
  82.     otherwise nop
  83.     end
  84.  
  85. exit
  86.  
  87.  
  88. /* HOLD ON <systemname> [,<flag> [,<absender>]]
  89. **
  90. ** Parameter:
  91. **
  92. **  systemname  = Name des Points/Systems
  93. **  flag        = Optional; entspricht es dem Wert 1, wird eine
  94. **                Rückantwort verschickt
  95. **  absender    = Optional; wird hier eine vollständige Mail-
  96. **                adresse angegeben, wird nicht auf Point ge-
  97. **                testet sondern an diesen die Rückantwort
  98. **                geschickt
  99. **
  100. ** Beschreibung:
  101. **
  102. **  Diese Routine entspricht einer Urlaubsfuntion. Sämtliche be-
  103. **  stellten Bretter des Points/Systems werden ausgetragen und
  104. **  in einer temporären Datei zwischengespeichert. Siehe auch
  105. **  maps.clrexxmod/HOLDOFF
  106. */
  107.  
  108. HOLDON:
  109.  
  110. if ~exists('CONNECTLINE:Rexx/Data') then do
  111.     call makedir('CONNECTLINE:Rexx/Data')
  112.     end
  113.  
  114.  
  115. if exists('CONNECTLINE:Rexx/Data/boards.'objname) then mode='A'
  116. else mode='W'
  117.  
  118.  
  119. if ~open('out','CONNECTLINE:Rexx/Data/boards.'objname,mode) then do
  120.     say 'Konnte Ausgabedatei nicht öffnen !'
  121.     exit
  122.     end
  123.  
  124. /* Brettliste durchsuchen */
  125.  
  126. say ''
  127. say 'Durchsuche Verteiler nach System 'objname'.'
  128.  
  129. x=CLGET_BoardList(brett)         /* Anzahl der Bretter ermitteln */
  130.  
  131. if x=0 then do
  132.     say 'Keine Brettliste gefunden !'
  133.     exit 20
  134.     end
  135.  
  136. if x>0 then do
  137.     do i=0 to x-1
  138.         call testforsystem
  139.         end
  140.     end
  141.  
  142. say 'Es wurden 'ctr' Verteiler von '||x||' Brettern geändert.'
  143.  
  144. call close 'Out'
  145.  
  146. say 'Speichere Brettliste.'
  147.  
  148. call CL_SaveBoardList()
  149. say 'Fertig.'
  150.  
  151. if param.1='1' then do
  152.     if param.2~='' then do
  153.         emp=CLGET_SystemPointuser(objname)
  154.         if emp='' then emp='sysop'
  155.         end
  156.     else emp=param.2
  157.     call CL_SendMailFull('MAPS',emp,'CONNECTLINE:Data/boards.'objname,,,'Your HOLD ON','TEXT','A')
  158.     end
  159.  
  160. return
  161.  
  162. testforsystem:
  163.  
  164. /* Verteilerstring wortweise nach System durchsuchen */
  165.  
  166.     found=false
  167.     anzahl=(CLGET_BoardBoxList(brett.i,verteiler))-1 /* Verteiler einlesen */
  168.     do y=0 to anzahl
  169.         if upper(objname)=upper(verteiler.y) then found=true     /* System gefunden */
  170.         end
  171.     if found=true then do
  172.         say 'Gefunden: /'brett.i
  173.         ctr=ctr+1
  174.         call CLSET_BoardDelBox(brett.i,objname) /* System austragen */
  175.         call CL_LogAdd('0','MAPS','System 'objname' aus /'brett.i' ausgetragen')
  176.         call writeln 'out',brett.i
  177.         end
  178.     return
  179.  
  180. /* HOLD OFF <systemname> [,<flag> [,<absender>]]
  181. **
  182. ** Parameter:
  183. **
  184. **  systemname  = Name des Points/Systems
  185. **  flag        = Optional; entspricht es dem Wert 1, wird eine
  186. **                Rückantwort verschickt
  187. **  absender    = Optional; wird hier eine vollständige Mail-
  188. **                adresse angegeben, wird nicht auf Point ge-
  189. **                testet sondern an diesen die Rückantwort
  190. **                geschickt
  191. **
  192. ** Beschreibung:
  193. **
  194. **  Dieser Befehl entspricht einer Urlaubsfunktion. Sämtliche,
  195. **  mittels HOLDON ausgetragenen Bretter, werden wieder einge-
  196. **  tragen.
  197. */
  198.  
  199. HOLDOFF:
  200.  
  201. if CLIS_SystemExists(objname)=FALSE then return
  202.  
  203. /* Eingabedatei öffnen */
  204.  
  205. if ~open('In','CONNECTLINE:Rexx/Data/boards.'objname,'R') then do
  206.     say system' wurde nicht von CL-BretterOff.rexx bearbeitet.'
  207.     exit 20
  208.     end
  209.  
  210. /* Zeilenweise einlesen, Verteiler ändern */
  211.  
  212. do until eof('In')
  213.     brett=readln('In')
  214.     if brett~='' then do
  215.         say 'Brett: /'brett
  216.         if ~CLSET_BoardAddBox(brett,objname) then
  217.             say 'Vernetzung fehlerhaft: 'brett
  218.         else do
  219.             call CL_LogAdd(0,'MAPS','System 'objname' in 'brett' eingetragen')
  220.             ctr=ctr+1
  221.             end
  222.         end
  223.     end
  224.  
  225. call close 'In'
  226. if param.1='1' then do
  227.     if param.2~='' then do
  228.         emp=CLGET_SystemPointuser(objname)
  229.         if emp='' then emp='sysop'
  230.         end
  231.     else emp=param.2
  232.     call CL_SendMailFull('MAPS',emp,'CONNECTLINE:Data/boards.'objname,,,'Your HOLD OFF','TEXT','A')
  233.     end
  234.  
  235. address command 'delete >NIL: Connectline:Rexx/data/boards.'||objname
  236. say 'System 'system' in 'ctr' Verteiler zurückgeschrieben.'
  237. say 'Speichere Brettliste.'
  238. call CL_SaveBoardList()
  239. return
  240.  
  241. /* LIST <systemname> [,<flag1>,<absender> [,<flag2>]]
  242. **
  243. ** Parameter:
  244. **
  245. **  systemname  = Name des Points/Systems
  246. **  flag1       = Ist der Wert = 1, so wird
  247. **                als Empfänger der Rückant-
  248. **                wort der User <absender>
  249. **                eingesetzt
  250. **  absender    = Absender der Nachricht an
  251. **                MAPS
  252. **  flag2       = Ist der Wert = 1, so wird
  253. **                nicht überprüft, ob das Sys-
  254. **                tem <systemname> existiert.
  255. **
  256. ** Beschreibung:
  257. **
  258. ** Erstellt eine Liste der Bretter und verschickt
  259. ** an den Point/das System
  260. */
  261.  
  262.  
  263. LIST:
  264.  
  265. call pragma 'P',-9
  266.  
  267. outfile='T:LIST.'objname||time(s)
  268. if ~open('out',outfile,'W') then exit 20
  269.  
  270. bestbrett=0
  271. pflichtbrett=0
  272. zugrbrett=0
  273.  
  274. if param.1='1' then do
  275.     if param.2='' then do
  276.         emp=CLGET_SystemPointuser(objname)
  277.         if emp='' then emp='root@'objname
  278.         end
  279.     else do
  280.         emp=param.2
  281.         if param.3='1' then notest=true
  282.         else notest=false
  283.         end
  284.     end
  285. else emp=CLGET_SystemPointuser(objname)
  286. emp=translate(emp,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')
  287. objname=translate(objname,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')
  288.  
  289. if ~(CLIS_SystemExists(objname))&(notest=false) then return
  290.  
  291. call mapskopf
  292. anzahl=CLGET_BoardList(brett)-1
  293. do x=0 to anzahl
  294.     noaccess=FALSE
  295.     access=CLGET_BoardValidateBox(brett.x,objname)
  296.     if access='' then do
  297.         access='1'
  298.         noaccess=TRUE
  299.         end
  300.     if access='1' then do
  301.         if noaccess=FALSE then zugrbrett=zugrbrett+1
  302.         end
  303.     ordered=FALSE
  304.     veranz=CLGET_BoardBoxList(brett.x,verteiler)-1
  305.     do y=0 to veranz
  306.         if upper(verteiler.y)=upper(objname) then ordered=TRUE
  307.         end
  308.     select
  309.         when ((access='0')&(ordered=FALSE))|(noaccess=TRUE) then     /* Zugriffsberechtigt? */
  310.             steuzei='-'
  311.         when (access='0')&(ordered=TRUE) then do                     /* Pflichtbezug? */
  312.             steuzei='!'
  313.             pflichtbrett=pflichtbrett+1
  314.             end
  315.         when (access='1')&(ordered=FALSE) then                       /* Zugriff und nicht bestellt? */
  316.             steuzei=' '
  317.         when (access='1')&(ordered=TRUE) then do                     /* Zugriff und bestellt? */
  318.             steuzei='+'
  319.             bestbrett=bestbrett+1
  320.             end
  321.         otherwise nop
  322.         end
  323.     call formatline brett.x
  324.     end
  325.  
  326. call mapstail
  327. call close 'out'
  328.  
  329.  
  330. call CL_SendMailFull('MAPS',emp,outfile,,,'Your LIST','TEXT','A')
  331. address command 'delete >NIL: 'outfile
  332. call CL_LogAdd(0,'MAPS','Brettliste an System 'objname' verschickt')
  333. say 'Brettliste für System 'objname' an User 'emp' verschickt.'
  334. return
  335.  
  336. formatline:
  337. param=arg(1)
  338. zeile=steuzei' /'param
  339. if length(zeile)<60 then do
  340.     do i=length(zeile) to 60
  341.         zeile=zeile' '
  342.         end
  343.     end
  344. zeile=zeile||CLGET_BoardAbout(param)
  345. call writeboth zeile
  346. return
  347.  
  348. mapskopf:
  349.  
  350. call writeboth '; ZC-Maps Version 3.1'
  351. call writeboth '; processed on <'CLGET_OwnSystemAddress()'> for user 'emp'.'
  352. call writeboth '; system: 'objname
  353. call writeboth '; date  : 'date()','time()
  354. call writeboth ';'
  355. return
  356.  
  357. mapstail:
  358.  
  359. call writeboth ';'
  360. call writeboth '; total number of groups:      'anzahl+1
  361. call writeboth '; number of ordered groups:    'bestbrett
  362. call writeboth '; number of accessible groups: 'zugrbrett
  363. call writeboth '; number of obligatory groups: 'pflichtbrett
  364. return
  365.  
  366. /* ADD <systemname>,<sourcefile> [,<absender>]
  367. **
  368. ** Parameter:
  369. **
  370. **  systemname  = Name des Points/Systems
  371. **  sourcefile  = Pfad und Name des ausgelager-
  372. **                ten Mailbodies mit den Brett-
  373. **                namen
  374. **  absender    = Empfänger der Rückantwort,
  375. **                optional
  376. **
  377. ** Beschreibung:
  378. **
  379. **  Wertet <sourcefile> aus und trägt das System
  380. **  in die dort angegebenen Brettnamen ein.
  381. */
  382.  
  383. ADD:
  384.  
  385. add=true
  386.  
  387. /* DEL <systemname>,<sourcefile> [,<absender>]
  388. **
  389. ** Parameter:
  390. **
  391. **  systemname  = Name des Points/Systems
  392. **  sourcefile  = Pfad und Name des ausgelager-
  393. **                ten Mailbodies mit den Brett-
  394. **                namen
  395. **  absender    = Empfänger der Rückantwort,
  396. **                optional
  397. **
  398. ** Beschreibung:
  399. **
  400. **  Wertet <sourcefile> aus und trägt das System
  401. **  aus dort angegebenen Brettverteilern aus.
  402. */
  403.  
  404. DEL:
  405.  
  406. if add=true then outfile='T:ADD.'objname||time(s)
  407. else outfile='T:DEL.'objname||time(s)
  408. if ~open('out',outfile,'W') then exit 20
  409.  
  410. ignbrett=0
  411. inexistent=0
  412. noaccess=0
  413. orderbrett=0
  414. changed=0
  415.  
  416. if param.2='' then do
  417.     emp=CLGET_SystemPointuser(objname)
  418.     if emp='' then emp='root'@objname
  419.     end
  420. else emp=param.2
  421. emp=translate(emp,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')
  422.  
  423. anzlines=CL_GetText(param.1,xline)-1
  424.  
  425. /* Auf Wildcards prüfen */
  426.  
  427. call mapskopf
  428.  
  429. do x=0 to anzlines
  430.     xline.x=word(xline.x,1)
  431.     if ((pos('*',xline.x)>0)|(pos('?',xline.x)>0))|((pos('~',xline.x)>0)|(pos('|',xline.x)>0)) then do
  432.         call writeboth '; analysing group pattern <'xline.x'> as:'
  433.         if left(xline.x,1)='/' then brett=substr(xline.x,2,length(xline.x)-1)
  434.         anzbretter=CLGET_BoardList(board,brett)
  435.         if anzbretter>0 then do
  436.             do i=x+1 to anzlines                                            /* Eintrag aus Liste raus */
  437.                 f=i-1
  438.                 xline.f=xline.i
  439.                 end
  440.             do i=0 to anzbretter-1                                          /* Neue Bretter in Liste */
  441.                 idx=anzlines+i
  442.                 xline.idx='/'board.i
  443.                 call writeboth ';  'xline.idx
  444.                 end
  445.             call writeboth '; pattern match count: 'anzbretter
  446.             call writeboth ';'
  447.             anzlines=anzlines+anzbretter-1                                  /* Counter korrigieren */
  448.             end
  449.         end
  450.     end
  451.  
  452. /* (Ab)Bestellung bearbeiten */
  453.  
  454. do x=0 to anzlines
  455.     if left(xline.x,1)~='/' then ignored=TRUE                                /* gültiger Brettname? */
  456.     else do
  457.         brett=substr(xline.x,2,length(xline.x))
  458.         brett=strip(brett)
  459.         ordered=FALSE
  460.         ignored=FALSE
  461.         if ~CLIS_BoardExists(brett) then exist=FALSE                        /* existiert Brett? */
  462.         else do
  463.             exist=TRUE
  464.             if CLGET_BoardValidateBox(brett,objname)='0' then access=FALSE  /* Zugriffsberechtigt? */
  465.             else do
  466.                 access=TRUE
  467.                 veranz=CLGET_BoardBoxList(brett,verteiler)-1
  468.                 do q=0 to veranz
  469.                     if (add=true)&(upper(verteiler.q)=upper(objname)) then do
  470.                         ordered=TRUE
  471.                         orderbrett=orderbrett+1
  472.                         end
  473.                     else if (add=false)&(upper(verteiler.q)=upper(objname)) then ordered=TRUE
  474.                     end
  475.                 if (add=false)&(ordered=FALSE) then orderbrett=orderbrett+1
  476.                 if add=true then do
  477.                     call CLSET_BoardAddBox(brett,upper(objname))
  478.                     call CL_LogAdd(0,'MAPS','System 'objname' in 'brett' eingetragen')
  479.                     end
  480.                 else do
  481.                     call CLSET_BoardDelBox(brett,upper(objname))
  482.                     call CL_LogAdd(0,'MAPS','System 'objname' aus 'brett' ausgetragen')
  483.                     end
  484.                 end
  485.             end
  486.         end
  487.      select
  488.         when ignored=TRUE then do
  489.             steuzei=' '
  490.             ignbrett=ignbrett+1
  491.             end
  492.         when exist=FALSE then do
  493.             steuzei=' '
  494.             inexistent=inexistent+1
  495.             end
  496.         when access=FALSE then do
  497.             steuzei='!'
  498.             noaccess=noaccess+1
  499.             end
  500.         otherwise do
  501.             if add=true then steuzei='+'
  502.             else steuzei=' '
  503.             call formatline brett
  504.             changed=changed+1
  505.             end
  506.         end
  507.     select
  508.         when ignored=TRUE then call writeboth '; <invalid group pattern>'
  509.         when exist=FALSE then  call writeboth "; <group doesn't exist>"
  510.         when access=FALSE then call writeboth '; <inaccessible group>'
  511.         when (add=true)&(ordered=TRUE) then  call writeboth '; <already ordered>'
  512.         when (add=false)&(ordered=FALSE) then call writeboth '; <not ordered>'
  513.         otherwise nop
  514.         end
  515.     end
  516.  
  517. call writeboth ';'
  518. call writeboth '; total number of entries              : 'changed
  519. call writeboth '; number of ignored group patterns     : 'ignbrett
  520. call writeboth '; number of inactive group patterns    : 'inexistent
  521. if add=true then call writeboth '; number of already active patterns    : 'orderbrett
  522. else call writeboth '; number of already inactive patterns  : 'orderbrett
  523. call writeboth '; number of inaccessible group patterns: 'noaccess
  524. call close 'out'
  525.  
  526. if add=true then call CL_SendMailFull('MAPS',emp,outfile,,,'Your ADD','TEXT','A')
  527. else call CL_SendMailFull('MAPS',emp,outfile,,,'Your DEL','TEXT','A')
  528. address command 'delete >NIL: 'outfile
  529. if add=true then say 'Brettbestellung für System 'objname' an User 'emp' verschickt.'
  530. else say 'Brettabbestellung für System 'objname' an User 'emp' verschickt.'
  531. return
  532.  
  533.  
  534. /* INDEX <systemname>,<sourcefile> [,<flag1>,<absender> [,<flag2>]]
  535. **
  536. ** Parameter:
  537. **
  538. **  systemname  = Name des Points/Systems
  539. **  sourcefile  = Pfad und Name der Quell-
  540. **                brettliste
  541. **  flag1       = Ist der Wert = 1, so wird
  542. **                als Empfänger der Rückant-
  543. **                wort der User <absender>
  544. **                eingesetzt
  545. **  absender    = Absender der Nachricht an
  546. **                MAPS
  547. **  flag2       = Ist der Wert = 1, so wird
  548. **                nicht überprüft, ob das Sys-
  549. **                tem <systemname> existiert.
  550. **
  551. ** Beschreibung:
  552. **
  553. ** Erstellt eine Auflistung der Inhalte der
  554. ** angegebenen Bretter.
  555. */
  556.  
  557. INDEX:
  558.  
  559.  
  560. outfile='T:INDEX.'objname||time(s)
  561. if ~open('out',outfile,'W') then exit 20
  562.  
  563. if param.2='1' then do
  564.     if param.3='' then do
  565.         emp=CLGET_SystemPointuser(objname)
  566.         if emp='' then emp='root@'objname
  567.         end
  568.     else do
  569.         emp=param.3
  570.         if param.4='1' then notest=true
  571.         else notest=false
  572.         end
  573.     end
  574. else do
  575.     emp=CLGET_SystemPointuser(objname)
  576.     if emp='' then emp='root@'objname
  577.     end
  578.  
  579. if notest=false then do
  580.     if ~CLIS_SystemExists(objname) then exit 20
  581.     end
  582.  
  583. emp=translate(emp,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')
  584. if ~(CLIS_SystemExists(objname))&(notest=false) then return
  585.  
  586. msgctr=0
  587.  
  588. anzlines=CL_GetText(param.1,xline)-1
  589.  
  590. /* Auf Wildcards prüfen */
  591.  
  592. call mapskopf
  593.  
  594. do x=0 to anzlines
  595.     xline.x=word(xline.x,1)
  596.     if ((pos('*',xline.x)>0)|(pos('?',xline.x)>0))|((pos('~',xline.x)>0)|(pos('|',xline.x)>0)) then do
  597.         call writeboth '; analysing group pattern <'xline.x'> as:'
  598.         if left(xline.x,1)='/' then brett=substr(xline.x,2,length(xline.x)-1)
  599.         if xline.x='*' then xline.x='#?'
  600.         anzbretter=CLGET_BoardList(board,brett)
  601.         if anzbretter>0 then do
  602.             do i=x+1 to anzlines                                            /* Eintrag aus Liste raus */
  603.                 f=i-1
  604.                 xline.f=xline.i
  605.                 end
  606.             do i=0 to anzbretter-1                                          /* Neue Bretter in Liste */
  607.                 idx=anzlines+i
  608.                 xline.idx='/'board.i
  609.                 call writeboth ';  'xline.idx
  610.                 end
  611.             call writeboth '; pattern match count: 'anzbretter
  612.             call writeboth ';'
  613.             anzlines=anzlines+anzbretter-1                                  /* Counter korrigieren */
  614.             end
  615.         end
  616.     end
  617.  
  618. /* Inhalte bearbeiten */
  619.  
  620. do x=0 to anzlines
  621.     if left(xline.x,1)~='/' then ignored=TRUE                                /* gültiger Brettname? */
  622.     else do
  623.         brett=substr(xline.x,2,length(xline.x))
  624.         brett=strip(brett)
  625.         ordered=FALSE
  626.         ignored=FALSE
  627.         if ~CLIS_BoardExists(brett) then exist=FALSE                        /* existiert Brett? */
  628.         else do
  629.             exist=TRUE
  630.             if CLGET_BoardValidateBox(brett,objname)='0' then access=FALSE  /* Zugriffsberechtigt? */
  631.             else do
  632.                 access=TRUE
  633.                 msganz=CLGET_MsgNumberOf(brett)-1
  634.                 if msganz>0 then do
  635.                     call CL_LogAdd(0,'MAPS','Erstelle Index von 'brett' für System 'objname)
  636.                     do i=0 to msganz
  637.                         subject=CLGET_MsgSubject(brett,i)
  638.                         filename=CLGET_MsgFilename(brett,i)
  639.                         shortcom=CLGET_MsgShortComment(brett,i)
  640.                         sender=CLGET_MsgFrom(brett,i)
  641.                         mid=CLGET_MsgMsgID(brett,i)
  642.                         readcount=CLGET_MsgReadCount(brett,i)
  643.                         incomed=CLGET_MsgIncomeDate(brett,i)
  644.                         sendd=CLGET_MsgSendDate(brett,i)
  645.                         bin=CLIS_MsgBinary(brett,i)
  646.                         length=CLGET_MsgBodyLength(brett,i)
  647.                         komleng=CLGET_MsgCommentLength(brett,i)
  648.                         ausg='; Article 'i' in group /'upper(brett)':'
  649.                         call writeboth ausg
  650.                         call writeboth '; 'copies('-',length(ausg)-2)
  651.                         call writeboth '; subject   : 'subject
  652.                         call writeboth '; group     : /'upper(brett)
  653.                         call writeboth '; sender    : 'sender
  654.                         if bin='1' then do
  655.                             call writeboth '; type      : binary'
  656.                             call writeboth '; filename  : 'filename
  657.                             end
  658.                         else call writeboth '; type      : text'
  659.                         call writeboth '; length    : 'length
  660.                         if shortcom~='' then call writeboth '; comment   : 'shortcom
  661.                         else call writeboth '; comment   : <none>'
  662.                         if komleng>0 then call writeboth '; long comm.: 'komleng
  663.                         else call writeboth '; long comm.: <none>'
  664.                         call writeboth '; sent      : 'sendd
  665.                         call writeboth '; received  : 'incomed
  666.                         call writeboth '; message id: 'mid
  667.                         call writeboth '; downloads : 'readcount
  668.                         call writeboth ';'
  669.                         msgctr=msgctr+1
  670.                         end
  671.                     end
  672.                 else do
  673.                     ausg='; No articles found in group /'upper(brett)
  674.                     call writeboth ausg
  675.                     call writeboth '; 'copies('-',length(ausg)-2)
  676.                     end
  677.             end
  678.         end
  679.      select
  680.         when ignored=TRUE then call writeboth '; /'upper(brett)': <pattern ignored>'
  681.         when exist=FALSE then call writeboth  '; /'upper(brett)': <pattern not active>'
  682.         when access=FALSE then call writeboth '; /'upper(brett)': <group not accessible>'
  683.         otherwise end
  684.         end
  685.     end
  686.  
  687. call writeboth ';'
  688. call writeboth '; total number of articles: 'msgctr
  689. call close 'out'
  690.  
  691. call CL_SendMailFull('MAPS',emp,outfile,,,'Your INDEX','TEXT','A')
  692. address command 'delete >NIL: 'outfile
  693. say 'Brettindizes für System 'objname' an User 'emp' verschickt.'
  694. return
  695.  
  696. /* HELP <systemname>,<sourcefile>,<language> [,<flag1>,<absender> [,<flag2>]]
  697. **
  698. ** Parameter:
  699. **
  700. **  systemname  = Name des Points/Systems
  701. **  sourcefile  = Name des Hilfstextes, keine
  702. **                Pfadangabe
  703. ** language     = Sprache
  704. **  flag1       = Ist der Wert = 1, so wird
  705. **                als Empfänger der Rückant-
  706. **                wort der User <absender>
  707. **                eingesetzt
  708. **  absender    = Absender der Nachricht an
  709. **                MAPS
  710. **  flag2       = Ist der Wert = 1, so wird
  711. **                nicht überprüft, ob das Sys-
  712. **                tem <systemname> existiert.
  713. **
  714. ** Beschreibung:
  715. **
  716. ** Verschickt einen Hilfstext
  717. */
  718.  
  719. HELP:
  720.  
  721. if param.2='' then exit 20              /* Keine Sprache angegeben */
  722. else do
  723.     param.1='CONNECTLINE:Online/'param.2'/'param.1
  724.     if ~exists(param.1) then exit 20
  725.     end
  726.  
  727. if param.3='1' then do
  728.     if param.4='' then do
  729.         emp=CLGET_SystemPointuser(objname)
  730.         if emp='' then emp='root@'objname
  731.         end
  732.     else do
  733.         emp=param.4
  734.         if param.5='1' then notest=true
  735.         else notest=false
  736.         end
  737.     end
  738. else do
  739.     emp=CLGET_SystemPointuser(objname)
  740.     if emp='' then emp='root@'objname
  741.     end
  742.  
  743. if notest=false then do
  744.     if ~CLIS_SystemExists(objname) then exit 20
  745.     end
  746.  
  747. call CL_SendMailFull('MAPS',emp,param.1,,,'Your HELP','TEXT','A')
  748. call CL_LogAdd(0,'MAPS','Verschicke Hilfstext für System 'objname' an 'emp)
  749. say 'Hilfstext für System 'objname' an 'emp' verschickt.'
  750. return
  751.  
  752. /* ERROR <systemname>,<sourcefile>,<subject>,<reason> [,<flag1>,<absender> [,<flag2>]]
  753. **
  754. ** Parameter:
  755. **
  756. **  systemname  = Name des Points/Systems
  757. **  sourcefile  = Pfad und Name des Mailbodies
  758. **  subject     = Betreff der Originalnachricht,
  759. **                steht in Datei, Pfad + Name
  760. **                derselben
  761. **  reason      = Fehlertext, ebenfalls Datei
  762. **  flag1       = Ist der Wert = 1, so wird
  763. **                als Empfänger der Rückant-
  764. **                wort der User <absender>
  765. **                eingesetzt
  766. **  absender    = Absender der Nachricht an
  767. **                MAPS
  768. **  flag2       = Ist der Wert = 1, so wird
  769. **                nicht überprüft, ob das Sys-
  770. **                tem <systemname> existiert.
  771. **
  772. ** Beschreibung:
  773. **
  774. ** Verschickt eine Fehlermeldung
  775. */
  776.  
  777. ERROR:
  778.  
  779. if ((param.1="''")|(param.1='""'))|(param.1='') then noBody=true
  780. else noBody=false
  781. if ((param.3='')|(param.3='""'))|(param.3="''") then param.3='unknown function'
  782. if param.4='1' then do
  783.     if param.5='' then do
  784.         if CLGET_SystemPointuser(objname)='' then
  785.             emp='root'@objname
  786.         else emp=CLGET_SystemPointuser(objname)'@'objname
  787.         end
  788.     else emp=param.5
  789.     end
  790. else do
  791.     if CLGET_SystemPointuser(objname)='' then
  792.         emp='root'@objname
  793.     else emp=CLGET_SystemPointuser(objname)'@'objname
  794.     end
  795.  
  796. if open('subjin',param.2,'R') then do
  797.     subject=readln('subjin')
  798.     call close 'subjin'
  799.     end
  800. else subject='MAPS Error'
  801.  
  802. if open('reasin',param.3,'R') then do
  803.     reason=readln('reasin')
  804.     call close 'reasin'
  805.     end
  806. else reason='unknown function'
  807.  
  808. outfile='T:ERROR.'objname||time(s)
  809. if ~open('out',outfile,'W') then exit 20
  810.  
  811. call writeboth 'The following error occured: 'reason
  812. call writeboth 'If you have any questions, please contact root@'CLGET_OwnSystemAddress()'.'
  813. if noBody=false then do
  814.     call writeboth '--'
  815.     call writeboth 'Your message:'
  816.     anz=CL_GetText(param.1,zeile)-1
  817.     do x=0 to anz
  818.         call writeln'out',zeile.x
  819.         end
  820.     end
  821. call close 'out'
  822.  
  823. call CL_SendMailFull('MAPS',emp,outfile,,,subject,'TEXT','A')
  824. address command 'delete >nil: 'outfile
  825. call CL_LogAdd(0,'MAPS','System 'objname': Fehler 'subject)
  826. say 'Fehlermeldung von MAPS an 'emp' verschickt.'
  827. return
  828.  
  829. writeboth:
  830. param=arg(1)
  831. call writeln 'out',param
  832. call writech STDOUT,param'0a'x
  833. return
  834.  
  835.